<script>
    (function ($) {
        // 高级搜索时间验证
        $('.js_searchBtn').click(function (e) {
            e.preventDefault();
            var formEl = $(this).closest('form');
            var timeRangeEls = formEl.find('.js-time-range-check');
            if (timeRangeEls.length > 0) {
                var startTime = '';
                var endTime = '';
                var timeRangeEl;
                for (var i = 0, len = timeRangeEls.length; i < len; i++) {
                    timeRangeEl = timeRangeEls.eq(i);
                    startTime = $.trim(timeRangeEl.find('.js-start-time').val());
                    endTime = $.trim(timeRangeEl.find('.js-end-time').val());
                    if (startTime && endTime && startTime > endTime) {
                        timeRangeEl.find('.js-start-time').effect('highlight');
                        timeRangeEl.find('.js-end-time').effect('highlight');
                        showMsg('结束时间应大于等于开始时间');
                        return;
                    }
                }
            }
            formEl.submit();
        });
    })(jQuery);
</script>